package com.five.delay.mq;

import java.io.IOException;

import com.five.delay.mq.MQProperties;
import com.five.delay.utils.CalendarUtils;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class MQBusiness {

    @RabbitListener(queues = MQProperties.DEAD_QUEUE_NAME)
    public void process(String message) throws IOException {
        System.out.println(CalendarUtils.getCurrentTimeByStr(0) + " 消费了一个超时订单，订单ID：" + message);
//		basicAck() //确认消费成功，并删除RabbitMQ中对应数据
    }
}
